package com.sikaryofficial.system.api;

import com.sikaryofficial.common.core.constant.ServiceNameConstants;
import com.sikaryofficial.common.core.domain.R;
import com.sikaryofficial.system.api.factory.RemoteProductFallbackFactory;
import com.sikaryofficial.system.api.model.ip.IpLocationVO;
import com.sikaryofficial.system.api.model.product.ProductStatisticsReq;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 产品接口
 *
 * @author qinjinyuan
 */
@FeignClient(contextId = "remoteProductService", value = ServiceNameConstants.BACKEND_SERVICE, fallbackFactory = RemoteProductFallbackFactory.class)
public interface RemoteProductService {
    /**
     * 自动处理处理获奖邮件发送
     *
     * @return 结果
     */
    @GetMapping("/activity/autoSendAwardsEmailNotice")
    R<Boolean> autoSendAwardsEmailNotice();

    /**
     * 二维码扫描统计更新
     * @return
     */
    @PostMapping("/product/statics/normalSave")
    R<Boolean> normalSave(@RequestBody ProductStatisticsReq req);

    /**
     * 通过IP获取国家、区域、城市数据
     * @param ip 输入IP
     * @return
     */
    @GetMapping("/gadm/getCountryArea/{ip}")
    R<IpLocationVO> getCountryArea(@PathVariable("ip") String ip);
}
